home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / ComponentUI.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  71 lines

  1. /*
  2.  * @(#)ComponentUI.java    1.10 98/01/23
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.plaf;
  22.  
  23. import com.sun.java.swing.JComponent;
  24.  
  25. import java.awt.Container;
  26. import java.awt.Dimension;
  27. import java.awt.Graphics;
  28. import java.awt.Insets;
  29.  
  30.  
  31. public abstract class ComponentUI
  32. {
  33.     public void installUI(JComponent c) {
  34.     }
  35.  
  36.     public void uninstallUI(JComponent c) {
  37.     }
  38.  
  39.     public void paint(Graphics g, JComponent c) {
  40.     }
  41.  
  42.     public void update(Graphics g, JComponent c) {
  43.     if (c.isOpaque()) {
  44.         g.setColor(c.getBackground());
  45.         g.fillRect(0, 0, c.getWidth(),c.getHeight());
  46.     }
  47.     paint(g, c);
  48.     }
  49.  
  50.     public Dimension getPreferredSize(JComponent c) {
  51.     return null;
  52.     }
  53.  
  54.     public Dimension getMinimumSize(JComponent c) {
  55.     return getPreferredSize(c);
  56.     }
  57.  
  58.     public Dimension getMaximumSize(JComponent c) {
  59.     return getPreferredSize(c);
  60.     }
  61.  
  62.     public boolean contains(JComponent c, int x, int y) {
  63.     return c.inside(x, y);
  64.     }
  65.  
  66.     public static ComponentUI createUI(JComponent c) {
  67.     throw new Error("ComponentUI.createUI not implemented.");
  68.     }
  69. }
  70.  
  71.